home *** CD-ROM | disk | FTP | other *** search
/ Turnbull China Bikeride / Turnbull China Bikeride - Disc 2.iso / STUTTGART / MATHS / ARCAUT / Automatons / Demon < prev    next >
Text File  |  1991-07-26  |  949b  |  36 lines

  1. AUTOMATON*
  2.  
  3.   Demon
  4.  
  5.   Devised by J E Connett, this produces regions of colour which grow out from
  6.   an initial soup, eating up their surroundings & in time usually develop
  7.   into spirals (called demons) which dominate the whole region. When prompted
  8.   try 15 as the total numer of states. The Moore neighbourhood is used. A
  9.   window 100x100 should be big enough to ensure spirals will form (by about
  10.   generation 270).
  11.  
  12. INITIALISATION*
  13.  
  14.   10DEF PROCdo
  15.   20*SetEval wrap on
  16.   30INPUT '"number of states";n%
  17.   40OSCLI("SetEval n "+STR$n%)
  18.   50ENDPROC
  19.  
  20. SCREEN*
  21.  
  22.   10DEF PROCdo
  23.   20DIM buf% 256:SYS "OS_ReadVarVal","n",buf%,256
  24.   30PROCsoup(35,!buf%,1)
  25.   40ENDPROC
  26.  
  27. CODE*
  28.  
  29. ( READ_NEIG
  30.   TM CELL - DUP 1 = IF (TM ==) [1-<n>] = IF (TM ==)
  31.   ML CELL - DUP 1 = IF (ML ==) [1-<n>] = IF (ML ==)
  32.   MR CELL - DUP 1 = IF (MR ==) [1-<n>] = IF (MR ==)
  33.   BM CELL - DUP 1 = IF (BM ==) [1-<n>] = IF (BM ==)
  34.   CELL ==                                           )
  35.  
  36. END*